<div class="info">
<h1 class="font_h1">Tạo mới danh mục</h1>
<?php if(isset($error))  : ?>
<h2 class="error_red"><?php echo $error;?></h2>
<?php endif;?>
<form id="frm_add" action="<?php echo base_url().'admin/category/add_update/'.@$uid?>" method="POST">
<table class="table1">
    <tr>
                <td width="20%">Tên danh mục(Tiếng việt)</td>
                <td width="80%">
                	<?php if(@$cats->name_cats!='') {?>
                    <input type="text" name="txt_name_cats" style="width:400px" value="<?=@$cats->name_cats;?>" />
                    <?php } else { ?>
                    <input type="text" name="txt_name_cats" style="width:400px" value="<?php set_value('txt_name_cats');?>"  />
                    <?php } ?>
                </td>
    </tr>   
    <tr>
                <td width="20%"></td>
                <td width="80%">
                	<span style="background: red;width:200px"><?php echo form_error('txt_name_cats');?></span>
                </td>
    </tr> 
      <tr>
                <td width="20%">Link URL</td>
                <td width="80%">
                	<?php if(@$cats->url!='') {?>
                    <input type="text" name="txt_url" style="width:400px" value="<?=@$cats->url;?>" />
                    <?php } else { ?>
                    <input type="text" name="txt_url" style="width:400px"  />
                    <?php } ?>
                </td>
    </tr>
     <tr>
                <td width="20%"></td>
                <td width="80%">
                	<span style="background: red;width:200px"><?php echo form_error('txt_url');?></span>
                </td>
    </tr> 
     <tr>
                <td width="20%">Thứ tự</td>
                <td width="80%">
                	<?php if(@$cats->order_cats!='') {?>
                    <input type="text" name="txt_order_cats" style="width:400px" value="<?=@$cats->order_cats;?>" />
                    <?php } else { ?>
                    <input type="text" name="txt_order_cats" style="width:400px"  />
                    <?php } ?>
                </td>
    </tr>
    <tr>
                <td width="20%">Danh mục cha</td>
                <td width="80%">
                	<select style="width: 200px;" name="txt_id_parent">
                    <option value="0">---------------Chọn----------</option>
                        <?php foreach($cats_parent as $row){?>
                            <?php if($cats->id_parent == $row->id_cats){ ?>
                            <option value="<?php echo $row->id_cats;?>" selected="selected"><?php echo $row->name_cats;?></option> 
                            <?php } else {?>
                            
                            <option value="<?php echo $row->id_cats;?>"><?php echo $row->name_cats;?></option>
                            <?php } ?>                            
                        <?php } ?>
                        
                    </select>
                </td>
    </tr>
    <tr>
                <td width="20%">Hiện thị</td>
                <td width="80%">
                	<select name="txt_active" style="width: 200px;">
                        <option value="0" <?php if(@$cats->active == 0) echo "selected";?>>Không</option>
                        <option value="1" <?php if(@$cats->active == 1) echo "selected";?>>Có</option>
                    </select>
                </td>
    </tr>
    <tr>
                <td width="20%"></td>
                <td width="80%">
                <a  class="button" onclick="$('#frm_add').submit()" href="javascript:void(0)">Lưu lại</a>
                 <a  class="button" href="<?php echo base_url().'admin/category/'?>">Quay lại</a>
                </td>
    </tr>
</table>
</form>
</div>